using System;

namespace Ro.Norc.ServiceStackClient
{	
	/// <summary>
	/// Custom argument for the ServiceResult event
	/// </summary>
	/// <typeparam name="TResult">
	/// The type of the response returned by the webservice call
	/// </typeparam>
	public class ServiceResultArgs<TResult> : EventArgs
	{
		/// <summary>
		/// The underlying result
		/// </summary>
		private TResult _result;
		
		private object _state;
		
		/// <summary>
		/// Creates a new ServiceResultArgs object
		/// </summary>
		/// <param name="result">
		/// The underyling result
		/// </param>
		public ServiceResultArgs (TResult result) : base()
		{
			_result = result;
		}
		
		public ServiceResultArgs (TResult result, object state) : this(result)
		{
			_state = state;
		}
		
		/// <summary>
		/// The result/response of the webservice call
		/// </summary>
		public TResult Result
		{
			get {
				return _result;
			}
		}
		
		public object State
		{
			get {
				return _state;
			}
		}
	}
}